package com.bicon.life.core.base.repository.jpa;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;

/**
 * 条件接口
 * 用户提供条件表达式接口
 * @Class Name Criterion
 * @Author lee
 * @Create In 2012-2-8
 */
public interface Criterion<T> {
    public enum Operator {
        NU, NNU, EQ, NE, LIKE, NOTLIKE, GT, LT, GTE, LTE, BETWEEN, AND, OR, JOIN
    }
    public Predicate toPredicate(Root<T> root, CriteriaQuery<?> query,
                                 CriteriaBuilder builder);
}
